<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>app组件</h3>
        <comp-a></comp-a>
        <comp-b></comp-b>
    </div>
    <hr>
    <template id="compB">
        <div>
            <h1>组件B</h1>
            <p>{{msg}}</p>
            <hr>
            <comp-c></comp-c>
        </div>
    </template>
</body>
<script>
    new Vue({
        el:"#app",
        components:{
            CompA:Vue.extend({
                template:"<h1>组件A：{{info}}</h1>",
                data(){
                    return {
                        info:"info变量"
                    };
                }
            }),
            "comp-b":{
               template:"#compB", 
               data(){
                   return {
                       msg:"msg变量"
                   }
               },
               components:{
                   CompC:{
                       template:"<h5>组件C</h5>"
                   }
               }
            }
        }
    });
</script>
</html>